<?php

namespace app\admin\model;

use app\common\model\TimeModel;
use think\facade\Config;
use Yansongda\Pay\Pay;
use Yansongda\Pay\Plugin\Wechat\Fund\Profitsharing\AddReceiverPlugin;

class MallProfitSharing extends TimeModel
{
    
    protected $name = "mall_profit_sharing";
    
    protected $deleteTime = "delete_time";
    
    
    public static function addMerchant($param)
    {
        //微信支付
        $config = Config::get('payConfig');
    
        $allPlugins = Pay::wechat($config)->mergeCommonPlugins([AddReceiverPlugin::class]);
        
        $result = Pay::wechat($config)->pay($allPlugins, $param);
        return $result->toArray();
    }
    
}